package com.gxa.common.utils;

import java.sql.Timestamp;
import java.util.Date;

public class MyUtils {

    /**
     * 返回三个月之前的Timestamp
     *
     * @return
     */
    public static Timestamp get3MonthBefore() {
        String startTime = DateUtils.addMothToDate(-3, new Date(), null);
        String substring = startTime.substring(0, 10)+" 00:00:00.0";
        Timestamp timestamp = TimestampUtils.string2Timestamp(substring);
        return timestamp;
    }

    /**
     * 返回某年的Timestamp
     *
     * @return
     */
    public static Timestamp getYearTimestamp(String year) {
        String str = year + "-01-01 00:00:00.0";
        Timestamp Timestamp = TimestampUtils.string2Timestamp(str);
        return Timestamp;
    }

}
